#include <iostream>
#include <string>
#include <functional>
#include <map>
using namespace std;
using namespace std::placeholders;
int add(int i, int j)
{
    return i + j;
}
auto mod = [](int i, int j)
{
    return i % j;
};
struct divide
{
    int operator()(int denominator, int divisor)
    {
        return denominator / divisor;
    }
};

int main()
{
    auto badd = bind(add, _1, _2);
    int (*fp)(int, int) = add;
    map<string, function<int(int, int)>> binops =
        {
            {"+", add},
            {"/", divide()},
            {"%", mod},
            {"*", [](int i, int j)
             { return i * j; }}};
    cout << badd(1, 3) << endl;
    cout << binops["+"](10, 5) << endl;
    cout << binops["/"](10, 5) << endl;
    cout << binops["*"](10, 5) << endl;
    cout << binops["%"](10, 5) << endl;

    return 0;
}